/************************************************************
 * Copyright (C), 2022-2030, dina. Co., Ltd.
 * FileName:        form_prompt_dlg.h
 * Author:          Dan Yin
 * Date:            2023-01-15
 * Description:     info prompt window class
 * Version:         1.0.0.0
 **********************************************************/

#ifndef FORM_PROMPT_DLG_H
#define FORM_PROMPT_DLG_H

// add necessary includes here
#include "ui/defines/global.h"
#include "qlineloading.h"

enum eumReplyType{E_REPLY_ADD, E_REPLY_EDIT, E_REPLY_DELETE};

namespace Ui {
class FormPromptWidget;
}

class FormPromptWidget : public QWidget
{
    Q_OBJECT

public:
    // Get an instance of "FormPromptWidget" class, if exist, return it
    static FormPromptWidget* getInstance(QWidget *pParent = nullptr);

    // Set the prompt info on window
    void setPromptInfo(QString sTitle, QString sPromptInfo, bool bShowConform = true, int nTimeout = 0);

    // Hide the prompt window
    void hideWindow();

protected:
    // Triggers an event before it is switch language
    void changeEvent(QEvent *event);

signals:

private slots:
    // Save the basic info after click the button
    void on_pushButton_Confirm_clicked();

    // Timeout & hide window
    void slotHideWindow();

private:
    // The default constructor
    explicit FormPromptWidget(QWidget *parent = nullptr);

    // The default destructor
    virtual ~FormPromptWidget();

    // After constructing object, initialize the object
    void _initialze();

    // Init the window style
    void _initUi();

    // Set Shadow under the window
    void _SetWindowShadow();

private:
    Ui::FormPromptWidget *ui;

    QTimer                      *m_pTimer = nullptr;
    QLineLoading                *m_pLineLoading = nullptr;
};

#endif // FORM_PROMPT_DLG_H
